<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>回复表</title>
  <link rel="stylesheet" href="/php/x-admin/Public/admin/css/font.css">
  <link rel="stylesheet" href="/php/x-admin/Public/admin/css/xadmin.css">
  <script src="/php/x-admin/Public/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="/php/x-admin/Public/admin/js/xadmin.js"></script>
</head>
<body>
<h1 style="margin-left: 20px;">评价回复</h1>
<hr class="hr15">
<form class="layui-form">
<div class="layui-form-item layui-form-text">
  <label class="layui-form-label">回复</label>
  <div class="layui-input-block">
      <input type="hidden" name="commit_id" value="<?php echo ($_GET['id']); ?>">
      <input type="hidden" name="user_id" value="<?php echo ($_GET['user_id']); ?>">
    <textarea placeholder="请输入内容" name="replay_content" class="layui-textarea"></textarea>
  </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="insert">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</div>
</form>
</body>
<script>
    $(function () {
        layui.use(['form'], function () {
            var form = layui.form
            //console.log(form)
            form.on('submit(insert)', function(data){
                console.log(data);
                $.ajax({
                    url: "/php/x-admin/index.php/Admin/Order/replay",
                    type: 'post',
                    dataType: 'json',
                    data: data.field,
                    success: function (res) {
                        switch (res.code) {
                            case 3:
                                layer.alert('内容不能为空', {icon: 5});
                                break;
                            case 2:
                                layer.alert('回复失败', {icon: 5},);
                                break;
                            case 1:
                                layer.alert('回复成功',function(){
                                    //location.href='/php/x-admin/index.php/Admin/Order/Order/comment'
                                    //break;
                                });
                        }
                    }
                })
                return false;
            });
        });
    });
</script>
</html>